#ifndef _ZLM_FRAMER_PULLER_HPP_
#define _ZLM_FRAMER_PULLER_HPP_

#include <thread>
#include "mk_frame.h"
#include "mk_player.h"
#include "FramePuller.hpp"

class ZLMFramePuller: public FramePuller {
public:
    ZLMFramePuller(const std::string &url, int rtp_type, pullerDataCallback cb_);
    ~ZLMFramePuller();
    void onGetMkFrame(const mk_frame frame);
    ZLMFramePuller(const ZLMFramePuller&) = delete;
    ZLMFramePuller& operator=(const ZLMFramePuller&) = delete;
private:
    void FramePullThread();
    void clearConfigFrames();
    unsigned char* configFrames;
    size_t configFramesSize;
    std::string m_input_url;
    bool m_puller_exit;
    mk_player player_;
    int m_recv_count;
    std::thread m_pull_thread;
};

#endif // _ZLM_FRAMER_PULLER_HPP_